package com.anbinh.doctor.request.controller;

import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

import android.content.Context;
import android.util.Log;

import com.anbinh.doctor.R;
import com.anbinh.doctor.model.AccountInfo;
import com.anbinh.doctor.model.Address;
import com.anbinh.doctor.model.AddressDetailt;
import com.anbinh.doctor.model.AppointMentDetailt;
import com.anbinh.doctor.model.AppointmentResultSearch;
import com.anbinh.doctor.model.CityResponse;
import com.anbinh.doctor.model.CountNotificaton;
import com.anbinh.doctor.model.DataResponse;
import com.anbinh.doctor.model.DiseaseManifestations;
import com.anbinh.doctor.model.DistrictResponse;
import com.anbinh.doctor.model.NewAvatar;
import com.anbinh.doctor.model.NotificationDetailt;
import com.anbinh.doctor.model.NotificationList;
import com.anbinh.doctor.model.ProfileResponse;
import com.anbinh.doctor.model.ResponExtraInfo;
import com.anbinh.doctor.model.ResponseAppointment;
import com.anbinh.doctor.model.ResponseAssistants;
import com.anbinh.doctor.model.ResponseComment;
import com.anbinh.doctor.model.ResponseDegree;
import com.anbinh.doctor.model.ResponseDetaitlComment;
import com.anbinh.doctor.model.ResponseDoctor;
import com.anbinh.doctor.model.ResponseDoctorPrice;
import com.anbinh.doctor.model.ResponseImage;
import com.anbinh.doctor.model.ResponseLanguage;
import com.anbinh.doctor.model.ResponsePatient;
import com.anbinh.doctor.model.ResponsePermission;
import com.anbinh.doctor.model.ResponsePermissionDetailt;
import com.anbinh.doctor.model.ResponseSchedules;
import com.anbinh.doctor.model.ResponseServices;
import com.anbinh.doctor.model.ResponseSpecial;
import com.anbinh.doctor.model.ResponseUploadImg;
import com.anbinh.doctor.model.SuggestNamePatient;
import com.anbinh.doctor.model.UserLogin;
import com.anbinh.doctor.service.request.OnRequest;
import com.anbinh.doctor.service.request.RequestManager;
import com.anbinh.doctor.service.volley.toolbox.GsonRequest;
import com.anbinh.doctor.service.volley.toolbox.MultiPartRequest;
import com.anbinh.doctor.utils.PatientOptionType;
import com.android.volley.Request.Method;
import com.android.volley.Response.ErrorListener;
import com.android.volley.Response.Listener;
import com.android.volley.VolleyError;

public class ServerController {
	private static String TAG = "ServerController";

	public static final String BASE_URL = "http://edev.easycare.vn/api/v2/";
	public static final String POST_LOGIN = BASE_URL
			+ "login/doctor?phone=%s&password=%s";
	public static final String GET_LIST_ADDRESS = BASE_URL
			+ "doctors/address/index?token=%s&numberOfRecords=%d&page=%d";
	public static final String GET_LIST_PATIENTS = BASE_URL
			+ "manaPatients/index?token=%s&page=%d&doctor_id=%d";
	public static final String GET_LIST_PATIENTS_SEARCH = BASE_URL
			+ "manaPatients/index?token=%s&page=%d&doctor_id=%d&name=%s";

	public static final String POST_SUGGEST_PATIENT = BASE_URL
			+ "notification/suggestNamePatient?token=%s&name=%s&doctorid=%d";

	public static final String GET_ADDRESS_DETAILT = BASE_URL
			+ "doctors/address/get?token=%s&address_id=%d";
	public static final String POST_ON_OFF_ADDRESS = BASE_URL
			+ "doctors/address/onOff?token=%s&address_id=%d&is_active=%d";
	public static final String POST_REMOVE_ADDRESS = BASE_URL
			+ "doctors/address/delete?token=%s&address_id=%d";

	public static final String POST_REMOVE_TROLY = BASE_URL
			+ "doctor/assistant/detach?token=%s&id=%d";
	public static final String POST_REMOVE_DOCTOR = BASE_URL
			+ "clinic/doctor/detach?token=%s&doctorId=%d";
	public static final String POST_REMOVE_MESSAGE = BASE_URL
			+ "notification/delete?token=%s&notification_id=%d&doctorid=%d";

	public static final String POST_REMOVE_PATIENTS = BASE_URL
			+ "manaPatients/detachPatient?token=%s&doctorId=%d&patientId=%d";

	public static final String GET_INFO_ACC = BASE_URL
			+ "account/getInfo?token=%s";

	public static final String POST_TAMHOAN = BASE_URL
			+ "doctors/manaappointment/addSchedulesPause?token=%s&date=%s&start_time=%s&end_time=%s&reason=%s";

	public static final String POST_ADD_ADDRESS = BASE_URL
			+ "doctors/address/add?token=%s&clinic_name=%s&address=%s&is_active=%d&is_default=%d&phone=%s&map_position=%s";
	public static final String POST_UPDATE_ADDRESS = BASE_URL
			+ "doctors/address/add?token=%s&id=%d&clinic_name=%s&address=%s&is_active=%d&is_default=%d&phone=%s&map_position=%s";
	public static final String GET_PROFILE = BASE_URL
			+ "doctors/profile/index?token=%s";

	public static final String SCHEDULE = BASE_URL
			+ "doctors/schedule/index?token=%s&date=%s&numberOfRecords=%d&doctorid=%d";
	public static final String ONOFF_SCHEDULE = BASE_URL
			+ "doctors/schedule/onOff?token=%s&is_active=%d&id=%d";

	public static final String DELETE_SCHEDULE = BASE_URL
			+ "doctors/schedule/delete?token=%s&id=%d&doctorid=%d";

	public static final String GET_TROLY = BASE_URL
			+ "doctor/assistant?token=%s";
	public static final String GET_DOCTOR = BASE_URL + "clinic/doctor?token=%s";

	public static final String GET_SEARCH_LICH_HEN = BASE_URL
			+ "doctors/manaappointment/search?token=%s&name=%s&doctorid=%d";
	public static final String GET_FAMILY_MEDICAL_HIS = BASE_URL
			+ "manaPatients/listFamilyMedicalHistory?token=%s&patient_id=%d";
	public static final String GET_DISEASE_MANIFESTION = BASE_URL
			+ "manaPatients/listDiseaseManifestations?token=%s&patient_id=%d&doctor_id=%d";
	public static final String GET_LIST_NOTE = BASE_URL
			+ "manaPatients/listNotePatient?token=%s&patient_id=%d&doctor_id=%d";
	public static final String GET_LIST_MEDICAL_HISTORY = BASE_URL
			+ "manaPatients/listMedicalHistory?token=%s&patient_id=%d&doctor_id=%d";
	public static final String GET_LIST_APPOINTMENT_PATIENT = BASE_URL
			+ "manaPatients/listAppointmentPatient?token=%s&patient_id=%d";

	public static final String GET_LIST_FAMILY_MEDIACAL_HIS = BASE_URL
			+ "manaPatients/listFamilyMedicalHistory?token=%s&patient_id=%d&doctor_id=%d";

	public static final String POST_ADD_FAMILY_MEDICAL_HIS = BASE_URL
			+ "manaPatients/pushFamilyMedicalHistory?token=%s&patient_id=%d&family_medical_history=%s&doctor_id=%d";
	public static final String POST_EDIT_FAMILY_MEDICAL_HIS = BASE_URL
			+ "manaPatients/pushFamilyMedicalHistory?token=%s&patient_id=%d&family_medical_history=%s&id=%d&doctor_id=%d";

	public static final String POST_ADD_LIST_MEDICAL_HIS = BASE_URL
			+ "manaPatients/pushMedicalHistory?token=%s&patient_id=%d&medical_history=%s&doctor_id=%d";
	public static final String POST_EDIT_LIST_MEDICAL_HIS = BASE_URL
			+ "manaPatients/pushMedicalHistory?token=%s&patient_id=%d&medical_history=%s&id=%d&doctor_id=%d";

	public static final String POST_ADD_NOTE = BASE_URL
			+ "manaPatients/pushNotePatient?token=%s&patient_id=%d&note=%s&doctor_id=%d";
	public static final String POST_EDIT_NOTE = BASE_URL
			+ "manaPatients/pushNotePatient?token=%s&patient_id=%d&note=%s&id=%d&doctor_id=%d";

	public static final String POST_ADD_DISEASE_MANIFESTION = BASE_URL
			+ "manaPatients/pushDiseaseManifestation?token=%s&patient_id=%d&disease_manifestations=%s&doctor_id=%d";
	public static final String POST_EDIT_DISEASE_MANIFESTION = BASE_URL
			+ "manaPatients/pushDiseaseManifestation?token=%s&patient_id=%d&disease_manifestations=%s&id=%d&doctor_id=%d";

	public static final String POST_NOTIFICATIONS_LIST = BASE_URL
			+ "notification/list?token=%s&page=%d&numberOfRecords=%d&doctorid=%d";
	public static final String POST_NOTIFICATIONS_SUGGEST = BASE_URL
			+ "notification/suggest?token=%s&name=%s&numberOfRecords=%d";

	public static final String POST_NOTIFICATIONS_DETAILT = BASE_URL
			+ "notification/detail?token=%s&notification_id=%d&doctorid=%d";

	public static final String POST_COUNT_NOTIFICATIONS = BASE_URL
			+ "notification/countNotification?token=%s";

	private static final String POST_TROLY = BASE_URL
			+ "doctor/assistant/post?token=%s&full_name=%s&phone=%s&email=%s&gender=%d&birthday=%s&city_id=%d&district_id=%d";
	private static final String POST_DOCTOR = BASE_URL
			+ "clinic/doctor/add?token=%s&full_name=%s&phone=%s&gender=%d&birthday=%s";

	private static final String POST_PATIENTS = BASE_URL
			+ "manaPatients/addPatient?token=%s&doctorid=%d&name=%s&phone=%s";

	private static final String POST_UPDATE_DOCTOR = BASE_URL
			+ "clinic/doctor/edit?token=%s&full_name=%s&phone=%s&gender=%d&birthday=%s&email=%s&doctorId=%d";

	private static final String GET_PERMISSION = BASE_URL
			+ "doctor/assistant/permissions?token=%s";

	public static final String POST_COMMENT_REAPLY = BASE_URL
			+ "doctor/comment/answer?token=%s&comment=%s&parent_id=%d";

	public static final String GET_CITY = BASE_URL
			+ "doctors/profile/getCity?token=%s";
	public static final String POST_CHECK_UPDATE = BASE_URL
			+ "doctors/schedule/checkUpdateSchedule?token=%s&id=%d&action=%s&doctorId=%d";
	public static final String GET_DISTRICT = BASE_URL
			+ "doctors/profile/getDistrict?token=%s&city_id=%d";

	public static final String POST_ONOFF_COMMENT = BASE_URL
			+ "doctor/comment/onoff?token=%s&id=%d";

	public static final String POST_ADD_LICH_KHAM = BASE_URL
			+ "doctors/schedule/create?token=%s&date=%s&start=%s&end=%s&doctor_address_id=%d&time_slots=%s&date_to=%s&date_repeat=%s&doctorid=%d";
	public static final String POST_EDIT_LICH_KHAM = BASE_URL
			+ "doctors/schedule/update?token=%s&date=%s&start=%s&end=%s&doctor_address_id=%d&time_slots=%s&date_to=%s&date_repeat=%s&id=%d&doctorid=%d";

	public static final String POST_ONSTSART_APP = BASE_URL
			+ "doctors/manaappointment/deleteShedulesPause?token=%s&schedules_pause_id=%d";

	public static final String POST_UPDATE_INFO = BASE_URL
			+ "doctors/profile/update?token=%s&doctor_name=%s&email=%s&gender=%d&city_id=%d&district_id=%d&birth_date=%s";
	private static final String POST_UPLOAD_IMG = BASE_URL
			+ "imagesDoctor/uploadImage?token=%s";
	private static final String POST_UPLOAD_IMG_PATIENT = BASE_URL
			+ "manaPatients/uploadImagePatient?token=%s&patient_id=%d&caption=%s&doctor_id=%d";

	private static final String POST_UPDATE_STATUS = BASE_URL
			+ "doctors/manaappointment/updateStatus?token=%s&id=%d&status=%d&doctorid=%d";
	private Context mContext;
	private static final String POST_PROFILE_UPLOAD_AVATAR = BASE_URL
			+ "account/uploadAvatar?token=%s&avatar";
	private static final String POST_PROFILE_UPLOAD_AVATAR_DOCTOR = BASE_URL
			+ "clinic/doctor/upload/avatar?token=%s&doctorId=%d";

	private static final String POST_RIGISTER = BASE_URL
			+ "register/doctor?phone=%s&full_name=%s&type=%s";

	private static final String POST_ADD_APPOINTMENT = BASE_URL
			+ "doctors/manaappointment/bookForPatient?token=%s&id=%d&full_name=%s&phone=%s&email=%s&visit_reason=%s&addressID=%s&address=%s&date=%s&time=%s";

	private static final String POST_ACTIVE_ACC = BASE_URL
			+ "users/active/activationCode?activationCode=%s";
	private static final String POST_RESEND_CODE_ACTIVE = BASE_URL
			+ "users/get/activationCode?phone=%s";
	private static final String POST_UP_DOW_LOCATTION = BASE_URL
			+ "doctors/address/updatePriority?token=%s&startPriorityOrder=%d&endPriorityOrder=%d";
	private static final String GET_EXTRAINFO = BASE_URL
			+ "extraInfo/index?token=%s&type=%d";
	private static final String POST_CHANGE_LOCATION_PRICE = BASE_URL
			+ "doctorPriceList/changePositionPriceList?token=%s&list=%s";
	private static final String POST_GCM = BASE_URL
			+ "push/gcm/register?token=%s&gcm_regid=%s";

	private static final String GET_SPECIAL = BASE_URL
			+ "extraInfo/getSpecial?token=%s&doctorid=%d";
	private static final String GET_DEGREE = BASE_URL
			+ "extraInfo/getDegree?token=%s";
	private static final String GET_CLINIC = BASE_URL
			+ "extraInfo/getClinicType?token=%s";

	private static final String GET_APPOINTMENT = BASE_URL
			+ "doctors/manaappointment/index?token=%s&date=%s&doctorid=%d";

	private static final String GET_LIST_PRICE = BASE_URL
			+ "doctorPriceList/index?token=%s";

	private static final String GET_LANGUAGE = BASE_URL
			+ "extraInfo/getLanguage?token=%s";
	private static final String GET_LIST_SERVICES = BASE_URL
			+ "doctors/listSevices?token=%s&parentID=%s";

	private static final String GET_APPOINTMENT_DETAILT = BASE_URL
			+ "doctors/manaappointment/details?token=%s&id=%s&doctorid=%d";

	private static final String POST_UPDATE_SERVICES = BASE_URL
			+ "doctors/updateSevices?token=%s&listID=%s";

	private static final String POST_APPELLATION = BASE_URL
			+ "extraInfo/pushAppellation?token=%s&appellation=%s";
	private static final String POST_ADD_PRICE_LIST = BASE_URL
			+ "doctorPriceList/pushPriceList?token=%s&content_price=%s&price=%s";

	private static final String POST_EDIT_PRICE_LIST = BASE_URL
			+ "doctorPriceList/pushPriceList?token=%s&content_price=%s&price=%s&id=%d";

	public static final String POST_DELETE_APPELLATION = BASE_URL
			+ "extraInfo/destroyAppellation?token=%s&id=%d";

	public static final String POST_DELETE_CHUYENKHOA = BASE_URL
			+ "extraInfo/destroySpecialistAssociations?token=%s&id=%d";
	public static final String POST_DELETE_BAI_VIET = BASE_URL
			+ "extraInfo/destroyArticles?token=%s&id=%d";

	public static final String POST_DELETE_POSITION = BASE_URL
			+ "extraInfo/destroyPosition?token=%s&id=%d";
	public static final String POST_DELETE_IMAGE = BASE_URL
			+ "imagesDoctor/destroyImage?token=%s&id=%d";
	public static final String POST_DELETE_IMAGE_PATIENT = BASE_URL
			+ "manaPatients/destroyImagePatient?token=%s&patient_id=%d&id=%d&doctor_id=%d";
	public static final String POST_REMOVE_LSKCB = BASE_URL
			+ "manaPatients/destroyMedicalHistory?token=%s&patient_id=%d&id=%d&doctor_id=%d";
	public static final String POST_REMOVE_LSKCBGD = BASE_URL
			+ "manaPatients/delAFamilyMedicalHistory?token=%s&patient_id=%d&id=%d&doctor_id=%d";

	public static final String POST_REMOVE_NOTE = BASE_URL
			+ "manaPatients/destroyNotePatient?token=%s&patient_id=%d&id=%d&doctor_id=%d";
	public static final String POST_REMOVE_BIEUHIEN = BASE_URL
			+ "manaPatients/destroyDiseaseManifestation?token=%s&patient_id=%d&id=%d&doctor_id=%d";

	public static final String POST_IMG_CHANGE_ACTIVE = BASE_URL
			+ "imagesDoctor/changeActive?token=%s&id=%d";
	public static final String POST_DELETE_COMMENT = BASE_URL
			+ "doctor/comment/delete?token=%s&id=%d";

	public static final String POST_ITEM_PRICE = BASE_URL
			+ "doctorPriceList/destroyPriceList?token=%s&id=%d";

	private static final String POST_EDIT_APPELLATION = BASE_URL
			+ "extraInfo/pushAppellation?token=%s&appellation=%s&id=%d";

	private static final String POST_ADD_POSITION = BASE_URL
			+ "extraInfo/pushPosition?token=%s&position=%s&address=%s";

	private static final String POST_ADD_BAIVIET = BASE_URL
			+ "extraInfo/pushArticles?token=%s&articles=%s&links=%s";
	private static final String POST_EDIT_BAIVIET = BASE_URL
			+ "extraInfo/pushArticles?token=%s&articles=%s&links=%s&id=%d";

	private static final String POST_ADD_HIEPHOI = BASE_URL
			+ "extraInfo/pushSpecialistAssociations?token=%s&specialist_association=%s";
	private static final String POST_EDIT_HIEPHOI = BASE_URL
			+ "extraInfo/pushSpecialistAssociations?token=%s&specialist_association=%s&id=%d";
	private static final String GET_IMG = BASE_URL
			+ "imagesDoctor/index?token=%s";
	private static final String GET_IMG_PATIENTS = BASE_URL
			+ "manaPatients/listImagePatient?token=%s&patient_id=%d&doctor_id=%d";

	private static final String POST_CHANGE_POSITION = BASE_URL
			+ "imagesDoctor/changePosition?token=%s&list=%s";
	private static final String POST_LOGOUT = BASE_URL
			+ "users/logout?token=%s&gcm_id=%s";

	private static final String GET_COMMENT = BASE_URL
			+ "doctor/comment?token=%s&page=%d";
	private static final String GET_LIST_APPOINTMENT = BASE_URL
			+ "doctors/manaappointment/index?token=?token=%s&date=%s";

	private static final String POST_SEARCH_COMMENT = BASE_URL
			+ "doctor/comment/search?token=%s&keyword=%s";
	private static final String GET_DETAILT_COMMENT = BASE_URL
			+ "doctor/comment/detail/%d?token=%s";

	private static final String POST_EDIT_POSITION = BASE_URL
			+ "extraInfo/pushPosition?token=%s&position=%s&address=%s&id=%d";

	private static final String POST_SPECIAL = BASE_URL
			+ "extraInfo/pushSpecial?token=%s&list=%s";
	private static final String POST_DEGREE = BASE_URL
			+ "extraInfo/pushDegree?token=%s&list=%s";
	private static final String POST_CLINIC = BASE_URL
			+ "extraInfo/pushClinicType?token=%s&list=%s";

	private static final String POST_PERMISSION_DETAILT = BASE_URL
			+ "doctor/assistant/setpermissions?token=%s&permissionId=%d&assistantId=%d&assistantPermissions=%s";

	private static final String GET_LIST_PERMISSION_DETAILT = BASE_URL
			+ "doctor/assistant/setpermissions?token=%s&permissionId=%d&assistantId=%d";

	private static final String POST_SET_PERMISSION = BASE_URL
			+ "doctor/assistant/setpermissions?token=%s&permissionId=%d&assistantPermissions=%s&assistantId=%d";

	private static final String POST_SERVICE = BASE_URL
			+ "doctors/updateSevices?token=%s&listID=%s&notChecked=%s";

	private static final String POST_LANGUAGE = BASE_URL
			+ "extraInfo/pushLanguage?token=%s&list=%s";

	private static final String POST_NOTIFICATION_REPLY_MESSAGE = BASE_URL
			+ "notification/sendMessage?token=%s&reply_for_notification_id=%d&sent_by_user_id=%d&title=%s&content=%s";

	private static final String POST_NOTIFICATION_SEND_MESSAGE = BASE_URL
			+ "notification/sendMessage?token=%s&sent_by_user_id=%d&title=%s&content=%s&doctorid=%d";

	private static ServerController mInstance = null;

	private ServerController(Context context) {
		mContext = context;
	}

	public static ServerController getInstance(Context context) {
		if (mInstance == null) {
			mInstance = new ServerController(context);
		}
		return mInstance;
	}

	public void requestSuggestPatients(String token, String name, int doctorid,
			final OnRequest<SuggestNamePatient> req) {
		String url = String.format(POST_SUGGEST_PATIENT, token, name, doctorid);
		url = url.replace(" ", "%20");
		Log.d("reuquestListSchedule", url);
		GsonRequest<SuggestNamePatient> request = new GsonRequest<SuggestNamePatient>(
				Method.POST, url, SuggestNamePatient.class, null,
				new Listener<SuggestNamePatient>() {

					@Override
					public void onResponse(SuggestNamePatient result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestNotificationSendMessage(String token,
			int sent_by_user_id, String title, String content,
			File attach_file, int doctorid, final OnRequest<DataResponse> req) {
		try {
			title = URLEncoder.encode(title, "UTF-8");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		try {
			content = URLEncoder.encode(content, "UTF-8");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		String url = String.format(POST_NOTIFICATION_SEND_MESSAGE, token,
				sent_by_user_id, title, content, doctorid);
		MultiPartRequest<DataResponse> request = new MultiPartRequest<DataResponse>(
				Method.POST, url, DataResponse.class,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						req.onError(-1, error.getMessage());
					}
				});
		if (attach_file != null) {
			request.addFileUpload("attach_file", attach_file);
		}
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestNotificationReplyMessage(String token,
			int reply_for_notification_id, int sent_by_user_id, String title,
			String content, File attach_file, int doctorid,
			final OnRequest<DataResponse> req) {
		try {
			title = URLEncoder.encode(title, "UTF-8");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		try {
			content = URLEncoder.encode(content, "UTF-8");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		String url = String.format(POST_NOTIFICATION_REPLY_MESSAGE, token,
				reply_for_notification_id, sent_by_user_id, title, content);
		Log.d("POST_NOTIFICATION_SEND_MESSAGE", url);
		MultiPartRequest<DataResponse> request = new MultiPartRequest<DataResponse>(
				Method.POST, url, DataResponse.class,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						req.onError(-1, error.getMessage());
					}
				});
		if (attach_file != null) {
			request.addFileUpload("attach_file", attach_file);
		}
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestNotificationDetailt(String token, int notification_id,
			int doctorid, final OnRequest<NotificationDetailt> req) {
		String url = String.format(POST_NOTIFICATIONS_DETAILT, token,
				notification_id, doctorid);
		url = url.replace(" ", "%20");
		Log.d("reuquestListSchedule", url);
		GsonRequest<NotificationDetailt> request = new GsonRequest<NotificationDetailt>(
				Method.POST, url, NotificationDetailt.class, null,
				new Listener<NotificationDetailt>() {

					@Override
					public void onResponse(NotificationDetailt result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestCountNotification(String token,
			final OnRequest<CountNotificaton> req) {
		String url = String.format(POST_COUNT_NOTIFICATIONS, token);
		url = url.replace(" ", "%20");
		Log.d("reuquestListSchedule", url);
		GsonRequest<CountNotificaton> request = new GsonRequest<CountNotificaton>(
				Method.POST, url, CountNotificaton.class, null,
				new Listener<CountNotificaton>() {

					@Override
					public void onResponse(CountNotificaton result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestNotificationList(String token, int page, int pageSize,
			int doctorid, final OnRequest<NotificationList> req) {
		String url = String.format(POST_NOTIFICATIONS_LIST, token, (page + 1),
				pageSize, doctorid);
		url = url.replace(" ", "%20");
		Log.d("reuquestListSchedule", url);
		GsonRequest<NotificationList> request = new GsonRequest<NotificationList>(
				Method.POST, url, NotificationList.class, null,
				new Listener<NotificationList>() {

					@Override
					public void onResponse(NotificationList result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestNotificationSearch(String token, String name,
			final OnRequest<NotificationList> req) {
		String url = String.format(POST_NOTIFICATIONS_SUGGEST, token, name, 20);
		url = url.replace(" ", "%20");
		Log.d("reuquestListSchedule", url);
		GsonRequest<NotificationList> request = new GsonRequest<NotificationList>(
				Method.POST, url, NotificationList.class, null,
				new Listener<NotificationList>() {

					@Override
					public void onResponse(NotificationList result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestAddEditListMedicalHistory(String token, int patient_id,
			String disease_manifestations, int id, int doctor_id,
			final OnRequest<DataResponse> req) {
		String url = "";
		if (id == -1) {
			url = String.format(POST_ADD_LIST_MEDICAL_HIS, token, patient_id,
					disease_manifestations, doctor_id);
		} else {
			url = String.format(POST_EDIT_LIST_MEDICAL_HIS, token, patient_id,
					disease_manifestations, id, doctor_id);
		}
		url = url.replace(" ", "%20");
		Log.d("reuquestListSchedule", url);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestAddEditNote(String token, int patient_id,
			String disease_manifestations, int id, int doctor_id,
			final OnRequest<DataResponse> req) {
		String url = "";
		if (id == -1) {
			url = String.format(POST_ADD_NOTE, token, patient_id,
					disease_manifestations, doctor_id);
		} else {
			url = String.format(POST_EDIT_NOTE, token, patient_id,
					disease_manifestations, id, doctor_id);
		}
		url = url.replace(" ", "%20");
		Log.d("reuquestListSchedule", url);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestAddEditFamilyMedicalHistory(String token,
			int patient_id, String disease_manifestations, int id,
			int doctor_id, final OnRequest<DataResponse> req) {
		String url = "";
		if (id == -1) {
			url = String.format(POST_ADD_FAMILY_MEDICAL_HIS, token, patient_id,
					disease_manifestations, doctor_id);
		} else {
			url = String.format(POST_EDIT_FAMILY_MEDICAL_HIS, token,
					patient_id, disease_manifestations, id, doctor_id);
		}
		url = url.replace(" ", "%20");
		Log.d("reuquestListSchedule", url);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestAddEditDiseaseManifestations(String token,
			int patient_id, String disease_manifestations, int id,
			int doctor_id, final OnRequest<DataResponse> req) {
		String url = "";
		if (id == -1) {
			url = String.format(POST_ADD_DISEASE_MANIFESTION, token,
					patient_id, disease_manifestations, doctor_id);
		} else {
			url = String.format(POST_EDIT_DISEASE_MANIFESTION, token,
					patient_id, disease_manifestations, id, doctor_id);
		}
		url = url.replace(" ", "%20");
		Log.d("reuquestListSchedule", url);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestDiseaseManifestations(String token, int patient_id,
			int doctorId, final OnRequest<DiseaseManifestations> req) {

		String url = String.format(GET_DISEASE_MANIFESTION, token, patient_id,
				doctorId);
		Log.d("reuquestListSchedule", url);
		GsonRequest<DiseaseManifestations> request = new GsonRequest<DiseaseManifestations>(
				Method.GET, url, DiseaseManifestations.class, null,
				new Listener<DiseaseManifestations>() {

					@Override
					public void onResponse(DiseaseManifestations result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestListNote(String token, int patient_id, int doctorId,
			final OnRequest<DiseaseManifestations> req) {

		String url = String.format(GET_LIST_NOTE, token, patient_id, doctorId);
		Log.d("reuquestListSchedule", url);
		GsonRequest<DiseaseManifestations> request = new GsonRequest<DiseaseManifestations>(
				Method.GET, url, DiseaseManifestations.class, null,
				new Listener<DiseaseManifestations>() {

					@Override
					public void onResponse(DiseaseManifestations result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestlistMedicalHistory(String token, int patient_id,
			int doctorId, final OnRequest<DiseaseManifestations> req) {

		String url = String.format(GET_LIST_MEDICAL_HISTORY, token, patient_id,
				doctorId);
		Log.d("reuquestListSchedule", url);
		GsonRequest<DiseaseManifestations> request = new GsonRequest<DiseaseManifestations>(
				Method.GET, url, DiseaseManifestations.class, null,
				new Listener<DiseaseManifestations>() {

					@Override
					public void onResponse(DiseaseManifestations result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestlistPatientsApp(String token, int patient_id,
			final OnRequest<AppointmentResultSearch> req) {

		String url = String.format(GET_LIST_APPOINTMENT_PATIENT, token,
				patient_id);
		Log.d("reuquestListSchedule", url);
		GsonRequest<AppointmentResultSearch> request = new GsonRequest<AppointmentResultSearch>(
				Method.GET, url, AppointmentResultSearch.class, null,
				new Listener<AppointmentResultSearch>() {

					@Override
					public void onResponse(AppointmentResultSearch result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestlistFamilyMedicalHistory(String token, int patient_id,
			int doctorId, final OnRequest<DiseaseManifestations> req) {

		String url = String.format(GET_LIST_FAMILY_MEDIACAL_HIS, token,
				patient_id, doctorId);
		Log.d("reuquestListSchedule", url);
		GsonRequest<DiseaseManifestations> request = new GsonRequest<DiseaseManifestations>(
				Method.GET, url, DiseaseManifestations.class, null,
				new Listener<DiseaseManifestations>() {

					@Override
					public void onResponse(DiseaseManifestations result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestListPatients(String token, int page, int doctor_id,
			String name, final OnRequest<ResponsePatient> req) {
		String url = "";
		if (name.isEmpty()) {
			url = String.format(GET_LIST_PATIENTS, token, page, doctor_id);
		} else {
			url = String.format(GET_LIST_PATIENTS_SEARCH, token, page,
					doctor_id, name);
		}

		Log.d("requestListPatients", url);
		GsonRequest<ResponsePatient> request = new GsonRequest<ResponsePatient>(
				Method.GET, url, ResponsePatient.class, null,
				new Listener<ResponsePatient>() {

					@Override
					public void onResponse(ResponsePatient result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void reuquestListSchedule(String token, String date,
			int numberOfRecords, int doctorid,
			final OnRequest<ResponseSchedules> req) {

		String url = String.format(SCHEDULE, token, date, numberOfRecords,
				doctorid);
		Log.d("reuquestListSchedule", url);
		GsonRequest<ResponseSchedules> request = new GsonRequest<ResponseSchedules>(
				Method.GET, url, ResponseSchedules.class, null,
				new Listener<ResponseSchedules>() {

					@Override
					public void onResponse(ResponseSchedules result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void reuquestListPermission(String token,
			final OnRequest<ResponsePermission> req) {

		String url = String.format(GET_PERMISSION, token);
		Log.d("reuquestListPermission", url);
		GsonRequest<ResponsePermission> request = new GsonRequest<ResponsePermission>(
				Method.GET, url, ResponsePermission.class, null,
				new Listener<ResponsePermission>() {

					@Override
					public void onResponse(ResponsePermission result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void reuquestListAssistants(String token,
			final OnRequest<ResponseAssistants> req) {

		String url = String.format(GET_TROLY, token);
		GsonRequest<ResponseAssistants> request = new GsonRequest<ResponseAssistants>(
				Method.GET, url, ResponseAssistants.class, null,
				new Listener<ResponseAssistants>() {

					@Override
					public void onResponse(ResponseAssistants result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void reuquestListDoctor(String token,
			final OnRequest<ResponseDoctor> req) {

		String url = String.format(GET_DOCTOR, token);
		Log.d("reuquestListDoctor", url);
		GsonRequest<ResponseDoctor> request = new GsonRequest<ResponseDoctor>(
				Method.GET, url, ResponseDoctor.class, null,
				new Listener<ResponseDoctor>() {

					@Override
					public void onResponse(ResponseDoctor result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void reuquestListServices(String token, String parentID,
			final OnRequest<ResponseServices> req) {

		String url = String.format(GET_LIST_SERVICES, token, parentID);
		GsonRequest<ResponseServices> request = new GsonRequest<ResponseServices>(
				Method.GET, url, ResponseServices.class, null,
				new Listener<ResponseServices>() {

					@Override
					public void onResponse(ResponseServices result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestAppointmentDetailt(String token, String id,
			int doctorid, final OnRequest<AppointMentDetailt> req) {

		String url = String
				.format(GET_APPOINTMENT_DETAILT, token, id, doctorid);
		Log.d("requestAppointmentDetailt", url);
		GsonRequest<AppointMentDetailt> request = new GsonRequest<AppointMentDetailt>(
				Method.GET, url, AppointMentDetailt.class, null,
				new Listener<AppointMentDetailt>() {

					@Override
					public void onResponse(AppointMentDetailt result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestGetListPrice(String token,
			final OnRequest<ResponseDoctorPrice> req) {

		String url = String.format(GET_LIST_PRICE, token);
		GsonRequest<ResponseDoctorPrice> request = new GsonRequest<ResponseDoctorPrice>(
				Method.GET, url, ResponseDoctorPrice.class, null,
				new Listener<ResponseDoctorPrice>() {

					@Override
					public void onResponse(ResponseDoctorPrice result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void reuquestGetListSearchLichkham(String token, String name,
			int doctorid, final OnRequest<AppointmentResultSearch> req) {

		String url = String.format(GET_SEARCH_LICH_HEN, token, name, doctorid);
		Log.d("reuquestGetListSearchLichkham", url);
		GsonRequest<AppointmentResultSearch> request = new GsonRequest<AppointmentResultSearch>(
				Method.GET, url, AppointmentResultSearch.class, null,
				new Listener<AppointmentResultSearch>() {

					@Override
					public void onResponse(AppointmentResultSearch result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void reuquestListImagesPatients(String token, int patient_id,
			int doctor_id, final OnRequest<ResponseImage> req) {

		String url = String.format(GET_IMG_PATIENTS, token, patient_id,
				doctor_id);
		Log.d("GET_IMG_PATIENTS", url);

		GsonRequest<ResponseImage> request = new GsonRequest<ResponseImage>(
				Method.GET, url, ResponseImage.class, null,
				new Listener<ResponseImage>() {

					@Override
					public void onResponse(ResponseImage result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void reuquestListImages(String token,
			final OnRequest<ResponseImage> req) {

		String url = String.format(GET_IMG, token);
		GsonRequest<ResponseImage> request = new GsonRequest<ResponseImage>(
				Method.GET, url, ResponseImage.class, null,
				new Listener<ResponseImage>() {

					@Override
					public void onResponse(ResponseImage result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void reuquestGetListAppointment(String token, String date,
			final OnRequest<ResponseAppointment> req) {

		String url = String.format(GET_LIST_APPOINTMENT, token);
		GsonRequest<ResponseAppointment> request = new GsonRequest<ResponseAppointment>(
				Method.GET, url, ResponseAppointment.class, null,
				new Listener<ResponseAppointment>() {

					@Override
					public void onResponse(ResponseAppointment result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestGetListComment(String token, int page,
			final OnRequest<ResponseComment> req) {
		String url = String.format(GET_COMMENT, token, page + 1);
		Log.d("requestGetListComment", url);

		GsonRequest<ResponseComment> request = new GsonRequest<ResponseComment>(
				Method.GET, url, ResponseComment.class, null,
				new Listener<ResponseComment>() {

					@Override
					public void onResponse(ResponseComment result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestCheckUpdate(String token, int id, String action,
			int doctorId, final OnRequest<DataResponse> req) {

		String url = String.format(POST_CHECK_UPDATE, token, id, action,
				doctorId);
		url = url.replace(" ", "%20");

		Log.d("requestChangePositionImg", url);

		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.GET, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestOnOffSchedule(String token, int status, int id,
			final OnRequest<DataResponse> req) {

		String url = String.format(ONOFF_SCHEDULE, token, status, id);
		url = url.replace(" ", "%20");

		Log.d("requestChangePositionImg", url);

		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestDeleteSchedule(String token, int id, int doctorId,
			final OnRequest<DataResponse> req) {

		String url = String.format(DELETE_SCHEDULE, token, id, doctorId);
		url = url.replace(" ", "%20");

		Log.d("requestChangePositionImg", url);

		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestPermissionAssistants(String token, int permissionId,
			String assistantPermissions, String assistantId,
			final OnRequest<DataResponse> req) {

		String url = String.format(POST_TROLY, token, permissionId,
				assistantPermissions, assistantId);
		url = url.replace(" ", "%20");

		Log.d("requestChangePositionImg", url);

		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestPushAssistants(String token, String full_name,
			String phone, String email, int gender, String birthday,
			int city_id, int district_id, final OnRequest<DataResponse> req) {

		String url = String.format(POST_TROLY, token, full_name, phone, email,
				gender, birthday, city_id, district_id);
		url = url.replace(" ", "%20");

		Log.d("requestChangePositionImg", url);

		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestPushPatients(String token, int doctorid,
			String full_name, String phone, final OnRequest<DataResponse> req) {

		String url = "";
		url = String.format(POST_PATIENTS, token, doctorid, full_name, phone);

		url = url.replace(" ", "%20");

		Log.d("requestChangePositionImg", url);

		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestPushDoctor(String token, String full_name, String phone,
			int gender, String birthday, int doctor_id, String email,
			int doctorid, final OnRequest<DataResponse> req) {

		String url = "";
		if (doctor_id == -1) {
			url = String.format(POST_DOCTOR, token, full_name, phone, gender,
					birthday);
		} else {
			url = String.format(POST_UPDATE_DOCTOR, token, full_name, phone,
					gender, birthday, email, doctorid);
		}

		url = url.replace(" ", "%20");

		Log.d("requestChangePositionImg", url);

		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestChangePositionImg(String token, String list,
			final OnRequest<DataResponse> req) {

		String url = String.format(POST_CHANGE_POSITION, token, list);
		Log.d("requestChangePositionImg", url);

		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestOnLogout(String token, String gcm_id,
			final OnRequest<DataResponse> req) {

		String url = String.format(POST_LOGOUT, token, gcm_id);
		Log.d("requestOnLogout", url);

		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestOnoffComment(String token, int id,
			final OnRequest<DataResponse> req) {

		String url = String.format(POST_ONOFF_COMMENT, token, id);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestAddLichKham(String token, String date, String start,
			String end, int doctor_address_id, String time_slots,
			String date_to, String date_repeat, int keyOption, int doctorid,
			final OnRequest<DataResponse> req) {
		String url;
		if (keyOption == -1) {
			url = String.format(POST_ADD_LICH_KHAM, token, date, start, end,
					doctor_address_id, time_slots, date_to, date_repeat,
					doctorid);
		} else {
			url = String.format(POST_EDIT_LICH_KHAM, token, date, start, end,
					doctor_address_id, time_slots, date_to, date_repeat,
					keyOption, doctorid);
		}

		Log.d("requestAddLichKham", url);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestPostTamHoan(String token, String date,
			String start_time, String end_time, String reason,
			final OnRequest<DataResponse> req) {

		String url = String.format(POST_TAMHOAN, token, date, start_time,
				end_time, reason);
		url = url.replace(" ", "%20");
		Log.d("requestPostTamHoan", url);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestOnstartAppointMent(String token, int id,
			final OnRequest<DataResponse> req) {

		String url = String.format(POST_ONSTSART_APP, token, id);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestReaplyComment(String token, String comment,
			int parent_id, final OnRequest<DataResponse> req) {

		String url = String.format(POST_COMMENT_REAPLY, token, comment,
				parent_id);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestDetailtComment(String token, int id,
			final OnRequest<ResponseDetaitlComment> req) {

		String url = String.format(GET_DETAILT_COMMENT, id, token);
		GsonRequest<ResponseDetaitlComment> request = new GsonRequest<ResponseDetaitlComment>(
				Method.GET, url, ResponseDetaitlComment.class, null,
				new Listener<ResponseDetaitlComment>() {

					@Override
					public void onResponse(ResponseDetaitlComment result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void reuquestSearchComment(String token,
			final OnRequest<ResponseComment> req) {

		String url = String.format(POST_SEARCH_COMMENT, token);
		GsonRequest<ResponseComment> request = new GsonRequest<ResponseComment>(
				Method.POST, url, ResponseComment.class, null,
				new Listener<ResponseComment>() {

					@Override
					public void onResponse(ResponseComment result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void reuquestDoctorLogin(String mPhone, String mPass,
			final OnRequest<UserLogin> req) {

		String url = String.format(POST_LOGIN, mPhone, mPass);
		GsonRequest<UserLogin> request = new GsonRequest<UserLogin>(
				Method.POST, url, UserLogin.class, null,
				new Listener<UserLogin>() {

					@Override
					public void onResponse(UserLogin result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						ErrorResponse er = ErrorResponse.newInStance(err);
						req.onError(er.getResponsecode(), er.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestpushService(String token, String list,
			String notChecked, final OnRequest<DataResponse> req) {
		String url = String.format(POST_SERVICE, token, list, notChecked);
		url = url.replace(" ", "%20");
		Log.d("requestPushSpecialList", url);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						Log.d("VolleyError", error.toString());
						req.onError(1, "-1");
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestAddPermission(String token, int permissionId,
			int assistantId, String assistantPermissions,
			final OnRequest<DataResponse> req) {
		String url = String.format(POST_PERMISSION_DETAILT, token,
				permissionId, assistantId, assistantPermissions);
		url = url.replace(" ", "%20");
		Log.d("requestPushSpecialList", url);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						Log.d("VolleyError", error.toString());
						req.onError(1, "-1");
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestPushDegree(String token, String list,
			final OnRequest<DataResponse> req) {
		String url = String.format(POST_DEGREE, token, list);
		url = url.replace(" ", "%20");
		Log.d("requestPushSpecialList", url);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						Log.d("VolleyError", error.toString());
						req.onError(1, "-1");
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestPushClinic(String token, String list,
			final OnRequest<DataResponse> req) {
		String url = String.format(POST_CLINIC, token, list);
		url = url.replace(" ", "%20");
		Log.d("requestPushSpecialList", url);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						Log.d("VolleyError", error.toString());
						req.onError(1, "-1");
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestPushLanguage(String token, String list,
			final OnRequest<DataResponse> req) {
		String url = String.format(POST_LANGUAGE, token, list);
		url = url.replace(" ", "%20");
		Log.d("requestPushSpecialList", url);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						Log.d("VolleyError", error.toString());
						req.onError(1, "-1");
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestPermissionDetailtList(String token, int permissionId,
			int assistantId, final OnRequest<ResponsePermissionDetailt> req) {
		String url = String.format(GET_LIST_PERMISSION_DETAILT, token,
				permissionId, assistantId);
		url = url.replace(" ", "%20");
		Log.d("requestPushSpecialList", url);
		GsonRequest<ResponsePermissionDetailt> request = new GsonRequest<ResponsePermissionDetailt>(
				Method.GET, url, ResponsePermissionDetailt.class, null,
				new Listener<ResponsePermissionDetailt>() {

					@Override
					public void onResponse(ResponsePermissionDetailt result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						Log.d("VolleyError", error.toString());
						req.onError(1, "-1");
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestPushSpecialList(String token, String list,
			final OnRequest<DataResponse> req) {
		String url = String.format(POST_SPECIAL, token, list);
		url = url.replace(" ", "%20");
		Log.d("requestPushSpecialList", url);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						Log.d("VolleyError", error.toString());
						req.onError(1, "-1");
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestAddAppointMent(String token, int id, String full_name,
			String phone, String email, String visit_reason, int addressID,
			String address, String date, String time,
			final OnRequest<DataResponse> req) {
		String url = String.format(POST_ADD_APPOINTMENT, token, id, full_name,
				phone, email, visit_reason, addressID, address, date, time);
		url = url.replace(" ", "%20");
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						Log.d("VolleyError", error.toString());
						req.onError(1, "-1");
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestRegister(String phone, String full_name, String type,
			final OnRequest<DataResponse> req) {
		String url = String.format(POST_RIGISTER, phone, full_name, type);
		url = url.replace(" ", "%20");
		Log.d("requestRegister", url);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						Log.d("VolleyError", error.toString());
						req.onError(1, "-1");
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestGetLanguage(String token,
			final OnRequest<ResponseLanguage> req) {
		String url = String.format(GET_LANGUAGE, token);
		url = url.replace(" ", "%20");
		GsonRequest<ResponseLanguage> request = new GsonRequest<ResponseLanguage>(
				Method.GET, url, ResponseLanguage.class, null,
				new Listener<ResponseLanguage>() {

					@Override
					public void onResponse(ResponseLanguage result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						Log.d("VolleyError", error.toString());
						req.onError(1, "-1");
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestGetAppointment(String token, String date, int doctorid,
			final OnRequest<ResponseAppointment> req) {
		String url = String.format(GET_APPOINTMENT, token, date, doctorid);
		url = url.replace(" ", "%20");
		Log.d("requestGetAppointment", url);
		GsonRequest<ResponseAppointment> request = new GsonRequest<ResponseAppointment>(
				Method.GET, url, ResponseAppointment.class, null,
				new Listener<ResponseAppointment>() {

					@Override
					public void onResponse(ResponseAppointment result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						Log.d("VolleyError", error.toString());
						req.onError(1, "-1");
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestGetDegree(String token,
			final OnRequest<ResponseDegree> req) {
		String url = String.format(GET_DEGREE, token);
		url = url.replace(" ", "%20");
		GsonRequest<ResponseDegree> request = new GsonRequest<ResponseDegree>(
				Method.GET, url, ResponseDegree.class, null,
				new Listener<ResponseDegree>() {

					@Override
					public void onResponse(ResponseDegree result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						Log.d("VolleyError", error.toString());
						req.onError(1, "-1");
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestGetClinic(String token,
			final OnRequest<ResponseDegree> req) {
		String url = String.format(GET_CLINIC, token);
		url = url.replace(" ", "%20");
		GsonRequest<ResponseDegree> request = new GsonRequest<ResponseDegree>(
				Method.GET, url, ResponseDegree.class, null,
				new Listener<ResponseDegree>() {

					@Override
					public void onResponse(ResponseDegree result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						Log.d("VolleyError", error.toString());
						req.onError(1, "-1");
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestGetSpecial(String token, int doctorid,
			final OnRequest<ResponseSpecial> req) {
		String url = String.format(GET_SPECIAL, token, doctorid);
		url = url.replace(" ", "%20");
		GsonRequest<ResponseSpecial> request = new GsonRequest<ResponseSpecial>(
				Method.GET, url, ResponseSpecial.class, null,
				new Listener<ResponseSpecial>() {

					@Override
					public void onResponse(ResponseSpecial result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						Log.d("VolleyError", error.toString());
						req.onError(1, "-1");
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestGetExtraInfo(String token, int type,
			final OnRequest<ResponExtraInfo> req) {
		String url = String.format(GET_EXTRAINFO, token, type);
		url = url.replace(" ", "%20");
		Log.d("requestGetExtraInfo", url);
		GsonRequest<ResponExtraInfo> request = new GsonRequest<ResponExtraInfo>(
				Method.GET, url, ResponExtraInfo.class, null,
				new Listener<ResponExtraInfo>() {

					@Override
					public void onResponse(ResponExtraInfo result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						Log.d("VolleyError", error.toString());
						req.onError(1, "-1");
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestendPriorityOrder(String token, int startPriorityOrder,
			int endPriorityOrder, final OnRequest<DataResponse> req) {
		String url = String.format(POST_UP_DOW_LOCATTION, token,
				startPriorityOrder, endPriorityOrder);
		Log.d("requestendPriorityOrder", url);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						Log.d("VolleyError", error.toString());
						req.onError(1, "-1");
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestChangeLocationPrice(String token, String list,
			final OnRequest<DataResponse> req) {
		String url = String.format(POST_CHANGE_LOCATION_PRICE, token, list);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						Log.d("VolleyError", error.toString());
						req.onError(1, "-1");
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestActiveRegister(String code,
			final OnRequest<UserLogin> req) {
		String url = String.format(POST_ACTIVE_ACC, code);
		GsonRequest<UserLogin> request = new GsonRequest<UserLogin>(
				Method.POST, url, UserLogin.class, null,
				new Listener<UserLogin>() {

					@Override
					public void onResponse(UserLogin result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						Log.d("onErrorResponse", error.toString());
						req.onError(-1, error.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void reuquestListAddress(String token, int page,
			final OnRequest<Address> req) {

		String url = String.format(GET_LIST_ADDRESS, token, 10, page + 1);
		Log.d("reuquestListAddress", url);
		GsonRequest<Address> request = new GsonRequest<Address>(Method.GET,
				url, Address.class, null, new Listener<Address>() {

					@Override
					public void onResponse(Address result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void reuquestAddressDetail(String token, int address_id,
			final OnRequest<AddressDetailt> req) {

		String url = String.format(GET_ADDRESS_DETAILT, token, address_id);
		GsonRequest<AddressDetailt> request = new GsonRequest<AddressDetailt>(
				Method.GET, url, AddressDetailt.class, null,
				new Listener<AddressDetailt>() {

					@Override
					public void onResponse(AddressDetailt result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void reuquestAddressOnOff(String token, int address_id,
			int is_active, final OnRequest<DataResponse> req) {

		String url = String.format(POST_ON_OFF_ADDRESS, token, address_id,
				is_active);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void reuquestRemoveImagePatient(String token, int patient_id,
			int id, int doctor_id, int keyOption,
			final OnRequest<DataResponse> req) {

		String url = "";

		if (keyOption == PatientOptionType.BIEUHIEN.getCode()) {
			url = String.format(POST_REMOVE_BIEUHIEN, token, patient_id, id,
					doctor_id);
		} else if (keyOption == PatientOptionType.LIST_NOTE.getCode()) {
			url = String.format(POST_REMOVE_NOTE, token, patient_id, id,
					doctor_id);
		} else if (keyOption == PatientOptionType.TIEU_SU_BENH_GIA_DINH
				.getCode()) {
			url = String.format(POST_REMOVE_LSKCBGD, token, patient_id, id,
					doctor_id);
		} else if (keyOption == PatientOptionType.LICH_SU_KHAM_CHUA_BENH
				.getCode()) {
			url = String.format(POST_REMOVE_LSKCB, token, patient_id, id,
					doctor_id);
		} else if (keyOption == PatientOptionType.IMAGE.getCode()) {
			url = String.format(POST_DELETE_IMAGE_PATIENT, token, patient_id,
					id, doctor_id);
		}

		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void reuquestAddressRemove(String token, int address_id,
			int is_active, final OnRequest<DataResponse> req) {

		String url = String.format(POST_REMOVE_ADDRESS, token, address_id,
				is_active);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestAssistiantRemove(String token, int id,
			final OnRequest<DataResponse> req) {

		String url = String.format(POST_REMOVE_TROLY, token, id);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestDoctorRemove(String token, int id,
			final OnRequest<DataResponse> req) {

		String url = String.format(POST_REMOVE_DOCTOR, token, id);
		Log.d("requestDoctorRemove", url);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestDeletePatient(String token, int doctorid,
			int patientsid, final OnRequest<DataResponse> req) {

		String url = String.format(POST_REMOVE_PATIENTS, token, doctorid,
				patientsid);
		Log.d("requestDoctorRemove", url);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestDeleteMessage(String token, int notification_id,
			int doctorid, final OnRequest<DataResponse> req) {

		String url = String.format(POST_REMOVE_MESSAGE, token, notification_id,
				doctorid);
		Log.d("requestDoctorRemove", url);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void reuquestAddressAdd(String token, String clinic_name,
			String address, int is_active, int is_default, String phone,
			String map_position, final OnRequest<DataResponse> req) {

		String url = String.format(POST_ADD_ADDRESS, token, clinic_name,
				address, is_active, is_default, phone, map_position);
		url = url.replace(" ", "%20");

		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void reuquestAddressUpdate(String token, int id, String clinic_name,
			String address, int is_active, int is_default, String phone,
			String map_position, final OnRequest<DataResponse> req) {

		String url = String.format(POST_UPDATE_ADDRESS, token, id, clinic_name,
				address, is_active, is_default, phone, map_position);
		url = url.replace(" ", "%20");
		Log.d("url", url);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestGetProfile(String token,
			final OnRequest<ProfileResponse> req) {
		String url = String.format(GET_PROFILE, token);
		Log.d("requestGetProfile", url);
		GsonRequest<ProfileResponse> request = new GsonRequest<ProfileResponse>(
				Method.GET, url, ProfileResponse.class, null,
				new Listener<ProfileResponse>() {

					@Override
					public void onResponse(ProfileResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestGetAccountInfo(String token,
			final OnRequest<AccountInfo> req) {
		String url = String.format(GET_INFO_ACC, token);
		GsonRequest<AccountInfo> request = new GsonRequest<AccountInfo>(
				Method.GET, url, AccountInfo.class, null,
				new Listener<AccountInfo>() {

					@Override
					public void onResponse(AccountInfo result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestCity(String token, final OnRequest<CityResponse> req) {
		String url = String.format(GET_CITY, token);
		GsonRequest<CityResponse> request = new GsonRequest<CityResponse>(
				Method.GET, url, CityResponse.class, null,
				new Listener<CityResponse>() {

					@Override
					public void onResponse(CityResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);

	}

	public void requestDistrict(String token, int cityID,
			final OnRequest<DistrictResponse> req) {
		String url = String.format(GET_DISTRICT, token, cityID);
		Log.d(TAG, url);

		GsonRequest<DistrictResponse> request = new GsonRequest<DistrictResponse>(
				Method.GET, url, DistrictResponse.class, null,
				new Listener<DistrictResponse>() {

					@Override
					public void onResponse(DistrictResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);

	}

	public void requestUpdateProfile(String token, String doctor_name,
			String email, int gender, int city_id, int district_id,
			String birth_date, final OnRequest<DataResponse> req) {
		String url = String.format(POST_UPDATE_INFO, token, doctor_name, email,
				gender, city_id, district_id, birth_date);
		url = url.replace(" ", "%20");
		Log.d(TAG, url);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);

	}

	public void requestUpdateStatusLichhen(String token, int id, int status,
			int doctorid, final OnRequest<DataResponse> req) {
		String url = String.format(POST_UPDATE_STATUS, token, id, status,
				doctorid);
		url = url.replace(" ", "%20");
		Log.d(TAG, url);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError err) {
						Log.d("onErrorResponse", err.toString());
						req.onError(-1, err.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);

	}

	public void requestdoRemoveImage(String token, int id,
			final OnRequest<DataResponse> req) {
		String url = String.format(POST_DELETE_IMAGE, token, id);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						req.onError(-1, error.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestdoRemovePrice(String token, int id,
			final OnRequest<DataResponse> req) {
		String url = String.format(POST_ITEM_PRICE, token, id);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						req.onError(-1, error.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestChangeActive(String token, int id,
			final OnRequest<DataResponse> req) {
		String url = String.format(POST_IMG_CHANGE_ACTIVE, token, id);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						req.onError(-1, error.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestDeleteComment(String token, int id,
			final OnRequest<DataResponse> req) {
		String url = String.format(POST_DELETE_COMMENT, token, id);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						req.onError(-1, error.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestdoResendActiveCode(String phone,
			final OnRequest<DataResponse> req) {
		String url = String.format(POST_RESEND_CODE_ACTIVE, phone);
		GsonRequest<DataResponse> request = new GsonRequest<DataResponse>(
				Method.POST, url, DataResponse.class, null,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						req.onError(-1, error.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestUploadAvatar(final String token, final File file,
			final OnRequest<NewAvatar> req) {
		String url = String.format(POST_PROFILE_UPLOAD_AVATAR, token);
		MultiPartRequest<NewAvatar> request = new MultiPartRequest<NewAvatar>(
				Method.POST, url, NewAvatar.class, new Listener<NewAvatar>() {

					@Override
					public void onResponse(NewAvatar result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						req.onError(-1, error.getMessage());
					}
				});
		request.addFileUpload("avatar", file);
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestUploadAvatarDoctor(final String token, final File file,
			int doctorId, final OnRequest<NewAvatar> req) {
		String url = String.format(POST_PROFILE_UPLOAD_AVATAR_DOCTOR, token,
				doctorId);
		MultiPartRequest<NewAvatar> request = new MultiPartRequest<NewAvatar>(
				Method.POST, url, NewAvatar.class, new Listener<NewAvatar>() {

					@Override
					public void onResponse(NewAvatar result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						req.onError(-1, error.getMessage());
					}
				});
		request.addFileUpload("avatar", file);
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestUploadImg(final String token, final File file,
			final OnRequest<ResponseUploadImg> req) {
		String url = String.format(POST_UPLOAD_IMG, token);
		MultiPartRequest<ResponseUploadImg> request = new MultiPartRequest<ResponseUploadImg>(
				Method.POST, url, ResponseUploadImg.class,
				new Listener<ResponseUploadImg>() {

					@Override
					public void onResponse(ResponseUploadImg result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						req.onError(-1, error.getMessage());
					}
				});
		request.addFileUpload("file", file);
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestUploadImgPatients(final String token, int patient_id,
			File file, String caption, int doctor_id,
			final OnRequest<ResponseUploadImg> req) {
		String url = String.format(POST_UPLOAD_IMG_PATIENT, token, patient_id,
				caption, doctor_id);
		url = url.replace(" ", "%20");
		Log.d("requestUploadImgPatients", url);
		MultiPartRequest<ResponseUploadImg> request = new MultiPartRequest<ResponseUploadImg>(
				Method.POST, url, ResponseUploadImg.class,
				new Listener<ResponseUploadImg>() {

					@Override
					public void onResponse(ResponseUploadImg result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						req.onError(-1, error.getMessage());
					}
				});
		request.addFileUpload("file", file);
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestRemoveExtanedData(final String token, int id, int type,
			final OnRequest<DataResponse> req) {
		String url = "";
		switch (type) {
		case R.id.chuc_vu:
			url = String.format(POST_DELETE_POSITION, token, id);
			break;
		case R.id.bang_cap:
			url = String.format(POST_DELETE_APPELLATION, token, id);
			break;
		case R.id.hiep_hoi_chuyen_khoa:
			url = String.format(POST_DELETE_CHUYENKHOA, token, id);
			break;
		case R.id.bai_viet:
			url = String.format(POST_DELETE_BAI_VIET, token, id);
			break;

		}
		Log.d("requestRemoveExtanedData", url);
		MultiPartRequest<DataResponse> request = new MultiPartRequest<DataResponse>(
				Method.POST, url, DataResponse.class,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						req.onError(-1, error.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestAddAppelletion(String token, String appellation, int id,
			final OnRequest<DataResponse> req) {
		String url = "";
		if (id == -1) {
			url = String.format(POST_APPELLATION, token, appellation);
		} else {
			url = String.format(POST_EDIT_APPELLATION, token, appellation, id);
		}
		url = url.replace(" ", "%20");
		Log.d("url", url);

		MultiPartRequest<DataResponse> request = new MultiPartRequest<DataResponse>(
				Method.POST, url, DataResponse.class,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						req.onError(-1, error.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);

	}

	public void requestAddPosition(String token, String mChucvu,
			String mNoilamviec, int id, final OnRequest<DataResponse> req) {
		String url = "";
		if (id == -1) {
			url = String.format(POST_ADD_POSITION, token, mChucvu, mNoilamviec);
		} else {
			url = String.format(POST_EDIT_POSITION, token, mChucvu,
					mNoilamviec, id);
		}

		Log.d("requestAddPosition", url);

		url = url.replace(" ", "%20");
		MultiPartRequest<DataResponse> request = new MultiPartRequest<DataResponse>(
				Method.POST, url, DataResponse.class,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						req.onError(-1, error.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestAddPriceList(String token, String content_price,
			String price, int id, final OnRequest<DataResponse> req) {
		String url = "";
		if (id == -1) {
			url = String.format(POST_ADD_PRICE_LIST, token, content_price,
					price);
		} else {
			url = String.format(POST_EDIT_PRICE_LIST, token, content_price,
					price, id);
		}

		Log.d("requestAddPosition", url);

		url = url.replace(" ", "%20");
		MultiPartRequest<DataResponse> request = new MultiPartRequest<DataResponse>(
				Method.POST, url, DataResponse.class,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						req.onError(-1, error.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestAddBaiViet(String token, String title, String link,
			int id, final OnRequest<DataResponse> req) {
		String url = "";
		if (id == -1) {
			url = String.format(POST_ADD_BAIVIET, token, title, link);
		} else {
			url = String.format(POST_EDIT_BAIVIET, token, title, link, id);
		}

		Log.d("requestAddPosition", url);

		url = url.replace(" ", "%20");
		MultiPartRequest<DataResponse> request = new MultiPartRequest<DataResponse>(
				Method.POST, url, DataResponse.class,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						req.onError(-1, error.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestAssociation(String token, String hiephoi, int id,
			final OnRequest<DataResponse> req) {
		String url = "";
		if (id == -1) {
			url = String.format(POST_ADD_HIEPHOI, token, hiephoi);
		} else {
			url = String.format(POST_EDIT_HIEPHOI, token, hiephoi, id);
		}

		Log.d("requestAddPosition", url);

		url = url.replace(" ", "%20");
		MultiPartRequest<DataResponse> request = new MultiPartRequest<DataResponse>(
				Method.POST, url, DataResponse.class,
				new Listener<DataResponse>() {

					@Override
					public void onResponse(DataResponse result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						req.onError(-1, error.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

	public void requestRegisterGcm(String token, String gcm_id,
			final OnRequest<DataResponse> req) {
		String url = String.format(POST_GCM, token, gcm_id);
		Log.d("requestRegisterGcm", url);
		MultiPartRequest<ResponseUploadImg> request = new MultiPartRequest<ResponseUploadImg>(
				Method.POST, url, ResponseUploadImg.class,
				new Listener<ResponseUploadImg>() {

					@Override
					public void onResponse(ResponseUploadImg result) {
						req.onSuccess(result);
					}
				}, new ErrorListener() {

					@Override
					public void onErrorResponse(VolleyError error) {
						req.onError(-1, error.getMessage());
					}
				});
		RequestManager.newInstance(mContext).addToRequestQueue(request);
	}

}
